package com.yxy.dao;

import com.yxy.entity.Sport;
import com.yxy.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);


    int checkPhone(String phone);
    int checkEmail(String email);

    User selectLogin(@Param("phone") String username, @Param("password") String password);//客户端登录

    int updatePasswordByPhone(@Param("phone") String username,@Param("passwordNew") String passwordNew);

    User selectUserByPhone(@Param("phone")String phone);
    /**
     * 后台管理
     * */
    User AdminLogin(User user);

    List<User> selectAll();

    List<User> findListByEntity(User user);

    int checkPassword(@Param(value="password")String password,@Param("id")Integer id);

    List<User> selectJoinSportPerson(Integer sportId);

    int insertContactPerson(@Param("userId")Integer userId, @Param("toUserId") Integer toUserId);

    int deleteContactPerson(@Param("userId")Integer userId, @Param("toUserId") Integer toUserId);

    List<User> selectContactPersonList(@Param("userId")Integer userId);

    int selectContactPerson(@Param("userId")Integer userId, @Param("toUserId") Integer toUserId);

}